package com.edmendst.xmall.service;


import com.edmendst.xmall.dto.*;
import com.edmendst.xmall.pojo.User;
import com.fasterxml.jackson.core.JsonProcessingException;
import org.springframework.web.multipart.MultipartFile;

import javax.validation.Valid;
import java.util.List;

/**
 * Creat by mjz
 */
public interface UserService {

    public String register(@Valid User user);

    //登录
    public String login(LoginRequest loginRequest);

    //注销
    public String logout(String token);

    UserInFo selectUserByUserName(String userName);

    int updateUserNickname(String userNickname, String userName);

    int updateUserSignature(String userSignature, String userName);

    int updateUserImage(MultipartFile userImage, String userName);

    int updateUserPassword(String userPassword1, String userPassword2, String userName);

    //申请成为卖方
    String updateUserType(UserTypeTranslate userTypeTranslate);

    //通过用户名查询用户id
    Integer selectUserIdByUserName(String userName);

    int addDeliveryInfo(String userName, DeliveryInfo deliveryInfo) throws JsonProcessingException;

//    int updateDeliveryInfo(String userName, DeliveryInfo deliveryInfo) throws JsonProcessingException;

//    String getDeliveryInfo(String userName) throws JsonProcessingException;

    //修改收货地址到默认地址
     int updateDefaultAddress(String userName, Long addressId) throws JsonProcessingException;

    //查询所有收货地址
    List<DeliveryInfo> getAllDeliveryInfoList(String userName);
}
